/*模拟内容弹出*/
function closepage(){
    $('.newpage').hide();
    $('.screenbg').hide();
    $('html').css('overflow','auto');
}
function showpage(o){
    $('html').css('overflow','hidden');
    $('.screenbg').show();
    $(o).show();
}
function popuppage(){
    $('.tagbox').click(function(){showpage('#articlepage');return false;});
    $('.search-result li').click(function(){showpage('#articlepage');return false;});
    $('.closepage').click(function(){closepage();return false;});
}
/*搜索*/
function search(){
    var _resultLi=$('.search-result li'),_length=_resultLi.length;
    var _prev=$('.search-result .prev'),
        _next=$('.search-result .next'),
        _pagenum=$('.search-result .pagenum'),
        _nothing=$('.search-result .nothing');
    $('#searchbtn').click(function(){
        $('.popularize').hide();
        _prev.hide();_next.hide();_pagenum.hide();_nothing.hide();
        _pagenum.find('span').text(_length);
        if(_length==0){_nothing.show();}
        else if(_length<=5){_pagenum.show();}
        else{_pagenum.show();_next.show();_prev.show();}
        $('.search-result').slideUp('fast',function(){
            $('.search-result').slideDown('normal',function(){$('.popularize').fadeIn();});
        });
    });
}
/*展开详情*/
function detail(){
    var _corner=$('.webheader .corner'),_con=$('.webdetail');
    _corner.click(function(){
        if(_con.is(':hidden')){
            _con.slideDown();_corner.text('收起');
        }else{
            _con.slideUp();_corner.text('展开');
        }
    });
}

$(document).ready(function(){
    //script begin
    popuppage();
    search();
    detail();
});



